//!!!!!!!!!
//When merging with this branch - need to add GameKit framework & Multipeer framework
//!!!!!!!!!




#import <Foundation/Foundation.h>

//File Paths - if you change anything in Resources change the name here!
#define kMessengerSpriteSheetFilename @"mainCharacters.plist"
#define kMessengerSpriteSheetImage @"mainCharacters.png"
#define kOtherSpritesSpriteSheetFilename @"otherSprites.plist"
#define kOtherSpritesSpriteSheetImage @"otherSprites.png"
#define kSpriteBackgroundScale 1.5

//main character init info
#define kMessengerFileNameBase @"running"
#define kMessengerEnemyFileNameBase @"runningBad"
#define kMessengerScale 0.5

//Action and animation parameters
//maybe we have to compute them based on the frames per second we run?
#define kMessengerRunFramesNumber 9
#define kMessengerRunAnimationDelay 0.05

//enemy
#define kMessengerEnemyRunFramesNumber 30
#define kMessengerEnemyRunAnimationDelay 0.05

//Player default abilities - might have to make them level specific
#define kMessengerInitialMaxSpeed ccp(100,0)
#define kMessengerTurboSpeed ccp(150,0)
#define kMessengerTurboDuration 3.0
#define kMessengerJumpHeight 100.0
#define kMessengerJumpDuration 1.5
#define kMessengerKickbackSpeed ccp(100,0)
#define kMessengerKickbackDuration 1
#define kMessengerPowerUpsNeededForTurbo 5

//Scene visions
#define kSelfYOffset -55
#define kEnemyYOffset -80


//Constants for computation
#define kBlindSpotForUserInteraction M_PI/8
#define kMinSwipeDistance 10

//Graphics
#define kTextureOverlapInPixels 801
#define kTextureScale 0.7

//OS version IS OS 7 OR LATER
#define kIsOS7OrLater  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)

//Names for notifactions when using network
#define kNetworkNotificationNameForCanceledLookingForAnOpponent @"CanceledLookingForAnOpponent"
#define kNetworkNotificationNameForConnectedPeer @"ConnectedPeer"
#define kNetworkNotificationNameForDisconnectedOpponent @"DisconnectedOpponent"
#define kNetworkNotificationNameForReceivedData @"ReceivedData"
#define kNetworkNotificationNameForEnteredBackground @"EnteredBackground"
#define kNetworkNotificationNameForBecameActive @"BecameActive"

#define kNetworkNotificationNamePlayerChoosingCharacter @"PlayerChoosingCharacter"
#define kNetworkNotificationNamePlayerWaitingForEnemyForChoosingCharacter @"EnemyChoosingCharacter"

#define kNetworkNotificationNamePlayerIsReadyToStart @"PlayerIsReadyToStart"
#define kNetworkNotificationNameOpponentIsReadyToStart @"OpponentIsReadyToStart"
#define kNetworkNotificationNamePingIsReceived @"PingIsReceived"

//Notification in NetworkManager
#define kNetworkManagerNotificationNameForReceivedData @"ReceivedDataFromPeer"
#define kNetworkManagerNotificationNameForDisconnecting @"Disconnected"

//Notification when going to Backgrund
#define kGoingToBackgroundNotificationName @"GoingToBackground"

//view for disconnected connection
#define kMessageViewOpponentChoosesLevelAndCharacter @"Please, wait...\nYour opponent is choosing the level and the character."
#define kTitleDisconnectedOpponent @"End game"
#define kMessageDisconnectedOpponent @"The connection with the opponent was lost."

//Notification for player PowerUps
#define kNotificationPlayerPowerUpChange @"PowerUpChange"

//alert view in collisions -> finish line
#define kAlertViewMenuButtonTitle @"Menu"
#define kAlertViewPlayAgainButtonTitle @"Play again"
#define kAlertViewShareButtonTitle @"Share"
#define kAlertViewDefaultTitle @"You Win!"
#define kAlertViewNewHighScoreTitle @"New HighScore!!!"
#define kAlertViewDefaultMessage @"Congratulations, Sir! You Delivered the message in time!"
#define kAlertViewNewHighScoreMessage @"Congratulations, Sir! New Best time!"
#define kAllertViewResumeButtonTitle @"Resume"
#define kAllertViewPauseTitle @"Pause"

//scene buttons titles
#define kSceneButtonTitleMenu @"[ Menu ]"
#define kSceneButtonTitlePause @"[ Pause ]"
#define kSceneButtonTitleSounds @"[ Sounds ]"
#define kSceneButtonFontNameVerdanaBold @"Verdana-Bold"
#define KSceneButtonFontColor [CCColor colorWithRed:112/255.0f green:76/255.0f blue:41/255.0f]

//sounds names
#define kPreloadEffectWin @"win.wav"
#define kPreloadEffectLose @"lose.wav"
#define kPreloadEffectJump @"jump.wav"
#define kPreloadEffectSlide @"slide.wav"
#define kPreloadEffectStart @"start.wav"
#define kPreloadEffectBump @"bump.wav"
#define kPreloadBackground @"background.m4a"

//switch with string
#define CASE(str)                       if ([__s__ isEqualToString:(str)])
#define SWITCH(s)                       for (NSString *__s__ = (s); ; )
#define DEFAULT

// -----------------------------------------------------------------------
// Custom types
// -----------------------------------------------------------------------
typedef enum {
    kMessengerSelf,
    kMessengerEnemy
} MessengerSpriteType;

typedef enum {
    kStateSliding,
    kStateRunning,
    kStateJumping,
    kStateBumpingkStateBumpingFrontOrBack,
    kStateBumpingBottom,
    kStateFalling,
    kStateBumpingTop,
    kStateTurbo,
} CharacterState;

typedef enum {
    kObjectTypeNone,
    kPowerUpTypeHealth,
    kPowerUpTypeSpeed,
    kObstacleLow,
    kObstacleHigh,
    kFinishLine
} GameObjectType;

//if they are more than 10, need to update sinding data in networking
typedef enum {
    kGameStateSinglePlayerChoosingLevel,
    kGameStateLaunchedSinglePlayer,
    kGameStateLaunchedMultiPlayer,
    kGameStateLookingForOpponent,
    kGameStateLookingWhoIsFirst,
    kGameStatePlayerWaitsForLevelAndCharacter,
    kGameStatePlayerChoosingLevelAndCharacter,
    kGameStateUserIsReady,
    kGameStatePaused,
    kGameStatePlaying,
    kGameStateMultiPlayerPlaying,
    kGameStateNotPlaying,
    kGameStateEndGame
} GameState;


//type game
typedef enum
{
    GamePlaySingleplayer,
    GamePlayMultiplayer,
    GamePlayNotPlaying
}GamePlaying;

//to be modified - based on needed information from player who choose lavel and character
typedef struct {
    MessengerSpriteType spriteCharacter;
    int level;
} CharacterAndLevelToPlay;

//reliable or unreliable sending data
typedef enum
{
    reliable,
    unreliable
}DataMode;


typedef struct
{
    CharacterState state;
    CGPoint position;
}EnemyInfo;
